#ifndef MAINWINDOW_H
#define MAINWINDOW_H

//#include <QMainWindow>
#include <QWebSocket>
#include <QWebSocketServer>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QObject
{
    Q_OBJECT

public:
    MainWindow(QObject *parent = nullptr);
    ~MainWindow();

    QWebSocketServer* m_pWebSocketServer;
    QVector<QWebSocket*> m_clients;
    QMap<QWebSocket*,QString> m_clientIDs;
    bool m_debug=true;
    QMap<QString,QVector<QWebSocket*>> m_rooms;

public slots:
    void on_pushButton_start_clicked();
    void processTextMessage(QString message);
    void processBinaryMessage(QByteArray message);
    void socketDisconnected();
    void onNewConnection();

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
